

export const formatTheTime = date => {
  const hour = date.getHours()
  const minute = date.getMinutes()
  return [hour, minute].map(formatNumber).join(':')
}

const formatNumber = n => {
  n = n.toString()
  return n[1] ? n : '0' + n
}

export const isEmpty = (value) => {
  var b = trim(value)
  if ((typeof value) === 'string') {
    return b ? false : true
  }
}
export const showToast = (message) => {
  wx.showToast({
    title: message,
    icon: 'none'
  })
}

function trim(a) {
  if (typeof a == 'string') {
    return a.replace(/\s+/, '');
  } else {
    return a;
  }
}

